<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:p="http://primefaces.prime.com.tr/ui">
   <h:head>
        <title>Chỉnh Sửa Giáo Viên</title>
    </h:head>
     <f:view>
       
        <h:form id="UserForm" prependId="false" >
                   <p:growl id="growl" showDetail="true" life="3000" /> 
                         <p:panel header=" Chỉnh Sửa Giáo Viên" style="background-color: #ebf3fd;">  
                            <h:panelGrid columns="2" cellpadding="5" >  
                                         <h:outputLabel for="username" value=" Mã Giáo Viên: " />  
                                         <h:outputLabel value="#{giaovienController.getRequest()}"   id="username"   />  
                                         <h:outputLabel for="tenmh" value=" Tên Giáo Viên : * " />  
                                         <h:inputText value="#{giaovienController.bean.tengv}"   id="tenmh" required="true" label="Tên Môn Học" />  
                                         <h:outputLabel value=" Ngày Sinh:  " />  
                                         <p:calendar value="#{giaovienController.bean.ngaysinh}" pattern="dd/MM/yyyy" /> 
                                         <h:outputLabel for="diachi" value=" Địa Chỉ :  " />  
                                         <h:inputText    value="#{giaovienController.bean.diachi}"   id="diachi" required="true"  /> 
                                         <h:outputLabel for="name" value=" Tên Đăng Nhập :  " />  
                                         <h:inputText    value="#{giaovienController.bean.name}"   id="name" required="true" /> 
                                         <h:outputLabel for="pass" value=" Password :  " />  
                                         <h:inputText    value="#{giaovienController.bean.password}"   id="pass" required="true"  /> 
                                    
                                         <h:commandButton value=" Done " action="#{giaovienController.movePageShow(giaovienController.bean)}"   />               
                                     
                           </h:panelGrid> 
                             
                       </p:panel> 
        </h:form>
                    <h:form id="hocphanForm" prependId="false" >
                   <p:panel header=" Danh Sách Học Phần " style="background-color: #ebf3fd;">  
                   <p:dataTable var="hp" value="#{giaovienController.getAllHocPhan(giaovienController.strId)}" id="list" selectionMode="single"  paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
   
        <p:column headerText=" Mã Học Phần" style="width:150px">      
                    <h:outputText value="#{hp.mahp}" />
        </p:column>

        <p:column headerText="Tên Học Phần" style="width:150px">
                    <h:outputText value="#{hp.tenhp}" />
        </p:column>
       
        <p:column headerText="Môn Học" style="width:150px">  
              <h:outputText value="#{hp.mamh}" />
                
        </p:column>
         <p:column headerText="Môn Học" style="width:150px">  
              <h:outputText value="#{hp.magv}" />
                
        </p:column>              
        <p:column headerText="Action">
            <h:commandButton value="Sửa" action="#{giaovienController.actionEditHocPhan(hp.mahp)}"  style ="padding-left: 20px; padding-right: 30px" >
                         <f:param name="id_hocphan" value="#{hp.mahp}" /> 
                         <f:param name="backpage" value="gvienedit" />
                         <f:param name="id_giaovien" value="#{hp.magv}" />
                </h:commandButton>
           
        </p:column>
          
    </p:dataTable>
                   </p:panel> 
                </h:form> 
       </f:view>
</html>

